package cn.suse.android.utils;

import java.util.List;


public class StringUtils {

	public static boolean isEmpty(String str){
		if(str==null||str.trim().equals("")){
			return true;
		}
		return false;
	}
	public static boolean isEmpty(List list){
		if(list == null|| list.size() == 0){
			return true;
		}
		return false;
	}
	public static int convertToInt(String s){
		int i;
		try {
			i=Integer.parseInt(s);
		} catch (NumberFormatException e) {
			i=0;
		}
		return i;
	}
	public static boolean isEmpty(String...params){
		if(params==null||params.length == 0){
			return true;
		}
		return false;
	}
	public static boolean isImage(String path){
		if(isEmpty(path)){
			return false;
		}
		path = path.toLowerCase();
		if(path.endsWith(".png")||path.endsWith(".jpeg")||path.endsWith(".bmp")||path.endsWith(".gif")||path.endsWith(".jpg")){
			return true;
		}
		return false;
		
	}
}
